package pers.wchen.mybatis.generate;

import pers.wchen.mybatis.generate.compose.BaseCompose;
import pers.wchen.mybatis.generate.compose.DefaultComposeManager;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @作者： wchen
 * @描述：
 * @创建时间： 2018/2/4 16:07
 * @版本：Copyright 2018, Inc. All Rights Reserved.
 * @修改信息：
 */
public class Main {


    public static void main(String[] args) throws Exception{
//        String filePath = FileUtil.class.getClassLoader().getResource("").getPath() + "xml.tm";
//        String filePath = FileUtil.class.getClassLoader().getResource("").toURI().getPath() + "xml.tm";
//
//        System.out.println(filePath);
//
//        FileUtil.readTemp(filePath);

        BaseCompose baseCompose = new DefaultComposeManager();
        baseCompose.getComposeContent();
//        String str = "&{param.transField}_${&{param.voLowerClassName}.id}";
//        System.out.println(str.replace("_", "${sysRoleVO.isAvailable?default"));

//        String str = "<@loop.for_{id,create_time,update_time}>\n" +
//                "                    <div class=\"form-group\">\n" +
//                "                        <label for=\"firstname\" class=\"col-sm-2 control-label\">&{param.comment}</label>\n" +
//                "                        <div class=\"col-sm-10\">\n" +
//                "                            <input type=\"text\" class=\"form-control\" id=\"&{param.transField}_add\" name=\"&{param.transField}\" placeholder=\"请输入&{param.comment}\" value=\"\">\n" +
//                "                        </div>\n" +
//                "                    </div>\n" +
//                "                    <@loop.for_end>";
//        Pattern pattern = Pattern.compile("[\\s]*<@loop.for[\\_\\{\\}\\,\\w]*>([\\u4e00-\\u9fa5\\-\\?\\$\\'\\+\\(\\)\\;\\w\\*\\<\\>\\=\\&\\\"\\.\\{\\}\\/\\s\\r\\n\\!\\'\\,\\#]+)");
//        Matcher matcher = pattern.matcher(str);
//        StringBuffer sbf = new StringBuffer();
//        while (matcher.find()){
//            System.out.println("-------");
//            System.out.println(matcher.group());
//
//
//        }


//        matcher.appendTail(sbf);
//        System.out.println("sbf:" + sbf.toString());
//        System.out.println("str:" + str);
    }
}
